package com.whyw.system.handler;

import com.whyw.entity.result.Result;
import org.springframework.web.bind.annotation.ExceptionHandler;
import org.springframework.web.bind.annotation.RestControllerAdvice;

@RestControllerAdvice
public class GlobalExceptionHandler {
    @ExceptionHandler(exception = Exception.class)
    public Result<?> globalException(Exception e) {
        return Result.error(e.getMessage());
    }
}
